package com.vegetable.modules.entity.stock.po;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * <p>
 * 库存表
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Stock更新对象", description="库存表")
public class StockUpdatePO extends BaseEntity {

    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "id更新时不能为空")
    private Long id;


    @ApiModelProperty(value = "调整数量")
    @NotNull(message = "调整数量不能为空")
    @Min(value = 0, message = "调整数量不能小于0")
    private Integer number;

    @ApiModelProperty(value = "调整重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "标签")
    private String tags;

    @ApiModelProperty(value = "调整类型：0盘点 1销售")
    private Integer updateType = 0;

}
